 {$cleo .cS}   
 0ACD: show_text_highpriority "Disabled" time 3000
 //end_thread

const

ticking_bomb = 13@
DISARMED_sound = 14@
BOMB_FAIL_sound = 16@
BOMB_FAIL_sound2 = 20@
LUIGI_zombie_sound = 21@
LUIGI_zombie_sound2 = 22@   
bomb_done = 9@
bomb = 10@
end
bomb_done = 0

04ED: load_animation  "BOMBER"
ticking_bomb = audiostream.Load3D("cleo\battle_maps\bomb_ticking.mp3")
DISARMED_sound = audiostream.Load3D("cleo\battle_maps\disarmed.mp3")
BOMB_FAIL_sound = audiostream.Load3D("cleo\battle_maps\alert_bomb.mp3")
BOMB_FAIL_sound2 = audiostream.Load3D("cleo\battle_maps\bomb_drop.mp3")   
LUIGI_zombie_sound = audiostream.Load3D("cleo\battle_maps\luigitacodead.mp3")
LUIGI_zombie_sound2 = audiostream.Load3D("cleo\battle_maps\luigi3.wav")


model.Load(#AK47)
model.Load(#SWAT)
023C: load_special_actor 'BB' as 1 // models 290-299

038B: load_requested_models
//0006: 7@ = 0 
if
023D:   special_actor  1 loaded

then
jump @to 


end
0ACD: show_text_highpriority "~r~Loading Luigi's Failed!" time 3000
end_thread

:loop_spawn
wait 0
if
32@ > 10000
then
32@ = 0
jump @to
end
if 
$onmission == 0
then
jump @quit

end
jump @loop_spawn
:to
0208: 2@ = random_float_in_ranges 90.2 150.2
0208: 8@ = random_float_in_ranges  90.2 150.2
//32@ = 10000
0208: 6@ = random_float_in_ranges  -150.2 -90.2
0208: 7@ = random_float_in_ranges  -150.2 -90.2

04C4: store_coords_to 23@ 27@ 28@ from_actor $PLAYER_ACTOR with_offset 2@ 8@ -5555.0 
04C4: store_coords_to 24@ 25@ 26@ from_actor $PLAYER_ACTOR with_offset 6@ 7@ -5555.0 
02C1: store_to 23@ 27@ 28@ ped_path_coords_closest_to  24@ 25@ 26@  

009A: 0@ = create_actor_pedtype 9 model #SWAT at  24@ 25@ 26@ 
0173: set_actor 0@ Z_angle_to  5.4244
0223: set_actor 0@ health_to 700 
//0638: AS_actor 0@ stay_put 1 
//077C: clear_actor 0@ acquaintance 4 to_all_pedtypes // see ped.dat 
//077C: clear_actor 0@ acquaintance 3 to_all_pedtypes // see ped.dat 
//077C: clear_actor 0@ acquaintance 2 to_all_pedtypes // see ped.dat 
//077C: clear_actor 0@ acquaintance 1 to_all_pedtypes // see ped.dat 
0006: 32@ = 0 
//0AAD: set_mp3 1@ perform_action 1 
060A: create_decision_maker_type 0 store_to 11@ // decision\allowed\m_.ped files 
0978: copy_decision_maker 11@ to 9@ 
060B: set_actor 0@ decision_maker_to 9@ 
0446: set_actor 0@ dismemberment_possible 0 
0006: 33@ = 0 
//081A: set_actor 0@ weapon_skill_to 3
actor.GiveWeaponAndAmmo(0@, AK47,99999)
0245: set_actor 0@ walk_style_to "player" 
 05DE: AS_actor 0@ walk_around_ped_path


0209: 17@ = random_int_in_ranges 0 17
MARKER.CreateAboveActor(10@,0@)
018B: set_marker 10@ radar_mode 2
marker.SetIconSize(10@, 1)
marker.SetColor(10@, 1)

audiostream.LinkToActor(ticking_bomb,0@)

audiostream.LinkToActor(DISARMED_sound,0@)

audiostream.LinkToActor(BOMB_FAIL_sound,0@)

audiostream.LinkToActor(BOMB_FAIL_sound2,0@)

//audiostream.LinkToActor(LUIGI_zombie_sound,0@)

//audiostream.LinkToActor(LUIGI_zombie_sound2,0@)
//audiostream.Loop(ticking_bomb,1)
//audiostream.Loop(LUIGI_zombie_sound2,1)
//audiostream.Loop(LUIGI_zombie_sound,1)
bomb_done = 0


:start_random


wait 0
0209: 18@ = random_int_in_ranges 0 16
if
18@ == 0 
then
00A1: put_actor 0@ at  24@ 25@ 26@  
actor.Angle(0@) =  0.4244
jump @main
end
if
18@ == 1 
then
00A1: put_actor 0@ at 23@ 27@ 28@ 
actor.Angle(0@) = 80.0858 
jump @main
end
if
18@ == 2
then
00A1: put_actor 0@ at  24@ 25@ 26@  
actor.Angle(0@) =  276.659
jump @main
end
if
18@ == 3
then
00A1: put_actor 0@ at 24@ 25@ 26@  
actor.Angle(0@) =  180.659
jump @main
end
if
18@ == 4
then
00A1: put_actor 0@ at  24@ 25@ 26@  
actor.Angle(0@) =  8.3466
jump @main
end
if
18@ == 5
then
00A1: put_actor 0@ at 23@ 27@ 28@ 
actor.Angle(0@) = 277.3367   
//actor.GiveWeaponAndAmmo(0@, pistol,99999)
jump @main
end
if
18@ == 6
then
00A1: put_actor 0@ at 24@ 25@ 26@  
actor.Angle(0@) =  229.744
jump @main
end
if
18@ == 7
then
00A1: put_actor 0@ at 24@ 25@ 26@ 
actor.Angle(0@) = 356.7801 
jump @main
end
if
18@ == 8
then
00A1: put_actor 0@ at 24@ 25@ 26@  
actor.Angle(0@) =  176.4675
jump @main
end
if
18@ == 9
then
00A1: put_actor 0@ at 24@ 25@ 26@ 
actor.Angle(0@) = 200.9199 
jump @main
end
if
18@ == 10
then
00A1: put_actor 0@ at 24@ 25@ 26@ 
actor.Angle(0@) = 1.0267 
jump @main
end
if
18@ == 11
then
00A1: put_actor 0@ at 23@ 27@ 28@ 
actor.Angle(0@) =  126.1434
jump @main
end
if
18@ == 12
then
00A1: put_actor 0@ at  24@ 25@ 26@  
actor.Angle(0@) =  355.6349
jump @main
end
if
18@ == 13
then
00A1: put_actor 0@ at 23@ 27@ 28@ 
actor.Angle(0@) = 172.9552 
jump @main
end
if
18@ == 14
then
00A1: put_actor 0@ at 23@ 27@ 28@ 
actor.Angle(0@) =  176.9061
jump @main
end

if
18@ == 15
then
00A1: put_actor 0@ at  24@ 25@ 26@ 
actor.Angle(0@) =  51.4671
jump @main
end
jump @start_random


:main 
0209: 18@ = random_int_in_ranges 0 26   
wait 0   
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0 
0AE1: 19@ = random_actor_near_point 3@ 4@ 5@ in_radius 8.0 find_next 1 pass_deads 1   

if
056D:   actor 19@ defined
then       
0AEA: 19@ = actor_struct 12@ handle

if  and
056D:   actor 12@ defined
056D:   actor 19@ defined
//

then
if  or
0A1B:   actor 12@ colliding_with_actor 19@
0105:   actor 12@ near_actor 19@ radius 3.0 3.0 3.3 sphere 0 on_foot
then
jump @start_random
end
end
end 
 

:base
//// 
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0 
0208: 2@ = random_float_in_ranges 90.2 150.2
0208: 8@ = random_float_in_ranges  90.2 150.2
//32@ = 10000
0208: 6@ = random_float_in_ranges  -150.2 -90.2
0208: 7@ = random_float_in_ranges  -150.2 -90.2

04C4: store_coords_to 23@ 27@ 28@ from_actor $PLAYER_ACTOR with_offset 2@ 8@ -5555.0 
04C4: store_coords_to 24@ 25@ 26@ from_actor $PLAYER_ACTOR with_offset 6@ 7@ -5555.0 
02C1: store_to 23@ 27@ 28@ ped_path_coords_closest_to  24@ 25@ 26@  
wait 0
//gosub @get_players 
if
$onmission == 0
then



:quit
:1
0296: unload_special_actor 1 
audiostream.Release(ticking_bomb)
audiostream.Release(DISARMED_sound)
audiostream.Release(BOMB_FAIL_sound)
audiostream.Release(BOMB_FAIL_sound2)
audiostream.Release(LUIGI_zombie_sound)
audiostream.Release(LUIGI_zombie_sound2)
04EF: release_animation "bomber"

if
056D:   actor 0@ defined

then

actor.DestroyInstantly(0@)             
end
end_thread
end

if

8104:  not actor $PLAYER_ACTOR near_actor 0@ radius 185.0 185.0 185.0 sphere 0

then

actor.DestroyInstantly(0@)
jump @clean 
end
jump @skip 

:clean

32@ = 0
//actor.DestroyInstantly(0@)
 audiostream.PerformAction(ticking_bomb,stop)
 audiostream.PerformAction(DISARMED_sound,stop)
 audiostream.PerformAction(BOMB_FAIL_sound2,stop)
 audiostream.PerformAction(BOMB_FAIL_sound,stop)
 audiostream.PerformAction(LUIGI_zombie_sound2,stop)
 audiostream.PerformAction(LUIGI_zombie_sound,stop)
jump @loop_spawn 

:skip 
if
$actor_sweet == 0

then
0A92: create_custom_thread "battle_maps\SA_luigi_bomb.cs"

jump @1      
end

:bomb_disarmed
if and
bomb_done == 0
0105:   actor $player_Actor near_actor 0@ radius 3.0 3.0 1.3 sphere 0 on_foot
056D:   actor $player_Actor  defined
then
0ACD: show_text_highpriority "~r~Player one: ~w~Press ~y~~k~~VEHICLE_ENTER_EXIT~~w~ to disfuse the bomb." time 500

if  
00E1:   player 0 pressed_key 15

then
00BE: text_clear_all

31@ = actor.EmulateFromPlayer($player_char)
jump @disfuse_bomb
end

end
:bomb_disarmed2
if  and
bomb_done == 0
056D:   actor $second_player_Actor  defined
then
if
0105:   actor $second_player_Actor near_actor 0@ radius 3.0 3.0 1.3 sphere 0 on_foot
then
0ACD: show_text_highpriority "~b~Player two: ~w~Press ~y~~k~~VEHICLE_ENTER_EXIT~~w~ to disfuse the bomb." time 500

if  
00E1:   player 1 pressed_key 15

then
00BE: text_clear_all

31@ = actor.EmulateFromPlayer($second_player)
jump @disfuse_bomb
end
end
end
if
actor.Dead(0@)
then
wait 1000
//$ryder_car += 1
/////remove cuz create_explosion_at 3@ 4@ 5@ type 11 camera_shake 3.0 
/////remove cuz show_styled_text "~r~-120 Seconds" time 3000 style 4
$Sweet_Car += 1
jump @1
end
jump @base




  {
:get_players
0209: 30@ = random_int_in_ranges 0 2

if
30@ == 0
then
31@ = actor.EmulateFromPlayer($player_char)
end
if  and
056D:   actor $second_player_Actor  defined
30@ == 1
then
31@ = actor.EmulateFromPlayer($second_player)

end
return     }


:disfuse_bomb
wait 0
if
056D:   actor 31@  defined
jf @main 
0615: define_AS_pack_begin 15@
0812: AS_actor -1 perform_animation "BOM_Plant" IFP "bomber" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1  // versionB
0616: define_AS_pack_end 15@

0618: assign_actor 31@ to_AS_pack 15@
061B: remove_references_to_AS_pack 15@
wait 2700

:random_sets
0209: 17@ = random_int_in_ranges 0 17
wait 0 
if 
17@ == 0
then
 
jump @fail_0_times
end
if 
17@ == 1
then
 
jump @fail2
end
if 
17@ == 2
then
 
jump @slight_pass
end
if 
17@ == 3
then
 
jump @pass
end
if 
17@ == 4
then
 
jump @slight_pass
end
if 
17@ == 5
then
jump @slight_pass2 

end
if 
17@ == 6
then
 
jump @slight_pass
end
if 
17@ == 7
then
 
jump @fail
end
if 
17@ == 8
then
 
jump @slight_pass2
end
if 
17@ == 9
then
 
jump @pass
end
if 
17@ == 10
then
 
jump @pass
end
if 
17@ == 11
then
 
jump @pass
end
if 
17@ == 12
then
 
jump @fail
end
if 
17@ == 13
then
 
jump @pass
end
if 
17@ == 14
then
 
jump @fail3
end
if 
17@ == 15
then
 
jump @slight_pass3
end
if 
17@ == 16
then
 
jump @pass
end
jump @slight_pass3


jump @main

:fail2
//actor.Health(0@) = 999999999999
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 4500     
audiostream.PerformAction(ticking_bomb,stop)                                   
audiostream.PerformAction(LUIGI_zombie_sound,play)
//// 
wait 5000
//bomb_done = 1
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0 
/////remove cuz create_explosion_at 3@ 4@ 5@ type 11 camera_shake 3.0 
$Sweet_Car += 1
actor.DestroyInstantly(0@)
$Actor_Truth -= 120
///remove cuz show_styled_text "~r~-120 Seconds" time 3000 style 4
jump @1 
jump @base


:pass
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 2500     
audiostream.PerformAction(ticking_bomb,stop)                                   
audiostream.PerformAction(DISARMED_sound,play)
//// 
wait 3000
$ryder_car += 1
$Actor_Truth += 60

///remove cuz show_styled_text "~w~60+ Seconds" time 3000 style 4

bomb_done = 1


jump @base


:fail
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 2500     
audiostream.PerformAction(ticking_bomb,stop)                                   
audiostream.PerformAction(LUIGI_zombie_sound,play)
//actor.Health(0@) = 999999999999
//// 
wait 5000
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0 
///remove cuz create_explosion_at 3@ 4@ 5@ type 11 camera_shake 3.0 

actor.DestroyInstantly(0@)
$Actor_Truth -= 120
///remove cuz show_styled_text "~r~-120 Seconds" time 3000 style 4
$Sweet_Car += 1
jump @1 
jump @base


:fail_0_times
//// 
//wait 5000
018B: set_marker 10@ radar_mode 0
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0 
///remove cuz create_explosion_at 3@ 4@ 5@ type 11 camera_shake 3.0 
  actor.DestroyInstantly(0@)
  $Actor_Truth -= 120
///remove cuz show_styled_text "~r~-120 Seconds" time 3000 style 4
$Sweet_Car += 1
jump @1
jump @base


:slight_pass
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 4500     
audiostream.PerformAction(ticking_bomb,stop)                                   
audiostream.PerformAction(DISARMED_sound,play)
//// 
wait 3000
$ryder_car += 1
$Actor_Truth += 60
///remove cuz show_styled_text "~w~60+ Seconds" time 3000 style 4

bomb_done = 1


jump @base

:slight_pass2
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 4500     
audiostream.PerformAction(ticking_bomb,stop)                                   
audiostream.PerformAction(BOMB_FAIL_sound,play)
//// 
wait 3000
$ryder_car += 1

bomb_done = 1

$Actor_Truth += 60
///remove cuz show_styled_text "~w~60+ Seconds" time 3000 style 4

jump @base


:slight_pass3
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 5500     
audiostream.PerformAction(LUIGI_zombie_sound,play)
wait 2800
audiostream.PerformAction(LUIGI_zombie_sound,stop)
audiostream.PerformAction(ticking_bomb,stop)                                   
audiostream.PerformAction(DISARMED_sound,play)
wait 3000
//// 
$Actor_Truth += 60
///remove cuz show_styled_text "~w~60+ Seconds" time 3000 style 4

$ryder_car += 1

bomb_done = 1


jump @base

:fail3
018B: set_marker 10@ radar_mode 0
audiostream.PerformAction(ticking_bomb,play)
wait 2500     
audiostream.PerformAction(ticking_bomb,stop)     
audiostream.PerformAction(DISARMED_sound,play)
wait 2700                              
audiostream.PerformAction(LUIGI_zombie_sound,play)
audiostream.PerformAction(DISARMED_sound,stop)
//actor.Health(0@) = 999999999999
//// 
wait 5000
04C4: store_coords_to 3@ 4@ 5@ from_actor 0@ with_offset 0.0 0.0 0.0 
///remove cuz create_explosion_at 3@ 4@ 5@ type 11 camera_shake 3.0 
 actor.DestroyInstantly(0@)
$Actor_Truth -= 120
///remove cuz show_styled_text "~r~-120 Seconds" time 3000 style 4

$Sweet_Car += 1
jump @1 
jump @base
//gosub @player_open   
{:bomb
if
056D:   actor 31@  defined

then
if
0642:   actor 31@ at_AS_origin 15@
then

end
end
if
856D: not  actor 31@  defined
then

end
if
856D: not  actor 31@  defined
then

end

jump @bomb     }
    {

:player_open
if
856D:  not actor 31@  defined
then


end
return

          }
          end_Thread



























